/**
 * Created by baoman on 2017/4/12.
 */
angular.module(moduleName + '.directives')
  .directive('hrRadio', function() {
    return {
      restrict: 'EA',
      templateUrl: 'hr-radio/hr-radio.html',
      replace: true,
      scope: {
        config: "=",
        showSign: "@",
        choose: "="
      },
      link: function(scope) {
        scope.choose = true;
        scope.change = function(label) {
          // console.log(label);
          // for (var i = 0; i < scope.config.items.length; i++) {
          //   if (scope.config.items[i].label == label) {
          //     scope.config.items[i].selected = true;
          //     scope.choose = scope.config.items[i].value;
          //   } else {
          //     scope.config.items[i].selected = false;
          //   }
          // }
          scope.choose = !scope.choose;
        }
        // scope.$watch('scope.choose', function(newValue) {

        //   if (newValue) {
        //     console.log(scope.choose)
        //   }
        // });
      }
    }
  });